package com.example.demo.user.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户余额表;
 * </p>
 *
 * @author 涛
 * @since 2024-08-01
 */
@Data
public class UUserAssets implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * id
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Integer id;

    /**
     * 服务人员ID;外键关联服务人员表
     */
    @TableField("UID")
    private String uid;

    /**
     * 账号总金额
     */
    @TableField("AMOUNT")
    private BigDecimal amount;

    /**
     * 可提现金额
     */
    @TableField("USE_AMOUNT")
    private BigDecimal useAmount;

    /**
     * 未结金额
     */
    @TableField("UNACCEPTED_AMOUNT")
    private BigDecimal unacceptedAmount;

    /**
     * 创建人
     */
    @TableField("CREATED_BY")
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value="CREATED_TIME",fill = FieldFill.INSERT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField("UPDATED_BY")
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value="UPDATED_TIME",fill = FieldFill.UPDATE)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime updatedTime;

    @Override
    public String toString() {
        return "UUserAssets{" +
        "id=" + id +
        ", uid=" + uid +
        ", amount=" + amount +
        ", useAmount=" + useAmount +
        ", unacceptedAmount=" + unacceptedAmount +
        ", createdBy=" + createdBy +
        ", createdTime=" + createdTime +
        ", updatedBy=" + updatedBy +
        ", updatedTime=" + updatedTime +
        "}";
    }
}
